class TimeDimension:
    MIN15 = "min"
    HOUR = "H"
    DAY = "d"
    WEEK = "w-mon"
    MONTH = "MS"
    QUARTER = "QS"
    YEAR = "YS"


class StatusCode:
    FAILED = 0
    SUCCEEDED = 1
    WAITING = 2
    PROCESSING = 3
    REWRITE = 4


class IndustryMap:
    FIRST_IND = 31
    SECOND_IND = 32
    THIRD_IND = 33

    MAP = {
        FIRST_IND: "第一产业",
        SECOND_IND: "第二产业",
        THIRD_IND: "第三产业",
    }


class AllIndustryMap:
    AllIndustry = 3

    MAP = {AllIndustry: "全行业"}


class DateType:
    DAY = 1
    MONTH = 2
    YEAR = 3
    QUARTER = 4


class SpecTypeMap:
    GENERAL_IND_AND_COM = 1
    HIGH_ENERGY_CON_IND = 2

    MAP = {GENERAL_IND_AND_COM: "一般工商业", HIGH_ENERGY_CON_IND: "大工业"}


class ConsType:
    ORDINARY_USER = 1
    VIRTUAL_USER = 2
    LINE_USER = 3
    TOTAL_USER = 4


class DataType:
    P_TOTAL = 1
    P_KT = 2
    P_BASE = 3
    P_STD_LEFT = 4
    P_STD_RIGHT = 5
    P_KT_EST = 6
    P_BASE_EST = 7


class AlertType:
    SUMMER_L1 = 1
    SUMMER_L2 = 2
    WINTER = 3

    # 若连续两天超过去年最大值的95%，则调控压降20%；若90%，则10%; 冬季也是10%
    THRESHOLD_MAP = {
        SUMMER_L1: 0.2,
        SUMMER_L2: 0.1,
        WINTER: 0.1
    }


class PlanType:
    NANRUI = 1
    ZHIXIANG = 2
